// the header file for QueryProcessor,
// is called by AutoTester,
// only calls those functions inside QueryProcessor.cpp & TNode.h

// -------------Imagination when using autotester:----------------
// string query = "assign a; SELECT a such that Modifies(a,"x")" ;
// QueryProcessor qp = new QueryProcessor();
// if(qp.setQuery(query)==true){// call query preprocessor
//     vector<int> result = gp.getResult(gp.getQuerryTree(),gp.getDefinitionTable());// call query evaluator
//     vector<string> output = gp.organizeResult(result); // call query projector
// }
// else{
//     cout<< "invalid query!";
// }

#ifndef QUERYPROCESSOR_H
#define QUERYPROCESSOR_H

#include "TNode.h"
#include <iostream>
#include <string>
#include <vector>
#include <list>
using namespace std;

class QueryProcessor {
public:
	// ------- constructor -----------
	QueryProcessor();
    // ------- functions for query preprocessor------
    static bool setQuery(string);
	static string getQueryStr();
	static TNode getRootOfQueryTree();
    // ------- functions for query evaluator -------
    static void getResult();
    // ------- functions for query projector -------
    static void organizeResult(list<string>&);
private:
    // ------ attributes for query preprocessor------
    static string query;
	static TNode root;// root node of query tree

    // ------- attributes for query evaluator------
	static vector<int> resultIndex;
	static bool resultBoolean;
	static string resultType;
    // ------- attributes for query projector -------

};

#endif
